var events=require("events");
var Emitter=events.EventEmitter;
function Dog(dogName){
    Emitter.call(this);
    this.dogName=dogName;
}
Dog.prototype=Emitter.prototype;//实现对EventEmitter的继承
Dog.prototype.bark=function(){
    console.log(this.dogName+"barked");
}
module.exports=Dog;//对外公布Dog构造函数